﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Niknak.Services.ServiceCore.Msmq
{
    /// <summary>
    /// Defines MSMQ connection and operation options
    /// </summary>
    public interface IMsmqConfig
    {
        /// <summary>
        /// Can be local, on the LAN or via a load balancer
        /// </summary>
        string MsmqWriteAddress { get; }
        /// <summary>
        /// Should be local to avoid security issues. NEVER point to a load balancer
        /// </summary>
        string MsmqReadAddress { get; }
        /// <summary>
        /// Must be greater than or equal to the number of CPU cores (incl. HyperTreading) available to the OS
        /// </summary>
        int MaxMessageProcessorThreads { get; }
        /// <summary>
        /// Optional. Configure a timespan in seconds to apply to the MaxMessagesHandledPerThrottleDuration value.
        /// </summary>
        int ThrottleDurationSeconds { get; }
        /// <summary>
        /// Optional. Limit the number of queue messages processed for each ThrottleDurationSeconds rolling window.
        /// </summary>
        int MaxMessagesHandledPerThrottleDuration { get; }
        /// <summary>
        /// Optional. The nubmer of seconds to wait before retrying the queue for a message after throttling
        /// </summary>
        int ThrottleRetrySeconds { get; }
    }
}
